package com.example.volunteeroa.repository;

import com.example.volunteeroa.entity.Volunteer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

@Repository
public interface VolunteerRepository extends JpaRepository<Volunteer,Integer>, JpaSpecificationExecutor<Volunteer>{

//    @Query("select e from Volunteer e where e.volunteerID=?1")
//    List<Volunteer>findByVolunteerID(String  volunteerID);
//
//    @Transactional
//    @Modifying
//    @Query(value="delete from volunteer where VolunteerID=?1 and name=?1",nativeQuery = true)
//    void deleteByVolunteerIDAndName(String VolunteerId,String name);
//    //通过志愿者号以及姓名删除一个人的信息
//
//    @Modifying
//    @Transactional
//    @Query(value="update Volunteer e set e.status=?2,e.changeTime=?3 where e.volunteerID=?1")
//    void changeVolunteerStatus(String volunteerID,String newstatus,String changeTime);
//    //通过志愿者ID找到并修改志愿者的状态,以及记录修改时间



}
